package com.chenchao.javaabstract;

/**
 * @encoding : UTF-8
 * @Time : 2020/11/10 15:54
 * @Author : Chen Chao
 * @File : javaSE.com.chenchao.javaabstract.Test1.java
 * @Software : IntelliJ IDEA
 * @since : 1.8
 * 接口的多继承
 */
public class Test1 {
}
class Animal{
    String name;
    String color;
}
interface SwimmingCapable{
    void swim();

    public static void main(String[] args) {
        Frog frog = new Frog();
        frog.walk();
        frog.swim();
    }
}
interface walkAble{
    void walk();
}
interface amphibiousAble extends SwimmingCapable,walkAble{
    //这里不需要再重新定义,因为你什么也改不了
    @Override
    void walk();
}
class Frog extends Animal implements amphibiousAble{
    String name="青蛙王子";

    @Override
    public void swim() {
        System.out.println("游动");
    }

    @Override
    public void walk() {
        System.out.println("爬行");
    }
}